package com.itheima.reggie.controller;

import com.itheima.reggie.common.ResultInfo;
import com.itheima.reggie.domain.Dish;
import com.itheima.reggie.service.DishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
public class DishController {
    @Autowired
    private DishService dishService;

    //显示菜品
    @GetMapping("/dish/list")
    public ResultInfo findAll(Long categoryId, Integer status){//接收参数
        //调用service
       List<Dish> list=dishService.findList(categoryId,status);
       //返回结果
        return ResultInfo.success(list);

    }

}
